package com.bw.dao;

import com.bw.pojo.Classes;
import com.bw.util.JDBC;

import java.sql.Connection;
import java.sql.PreparedStatement;
import java.sql.SQLException;

/***************************
 FileAction:

 CreateTime:2022-04-13 9:09
 Author:Aaking-aline
 ****************************/
public class ClassesDao {

    public void insertClasses(Classes classes) throws SQLException {
        String sql = "insert into classes values(null,?,?,?)";

        Connection connection = JDBC.getConnection();

        PreparedStatement ps = connection.prepareStatement(sql);

        ps.setObject(1,classes.getClass_name());
        ps.setObject(2,classes.getTeacher_name());
        ps.setObject(3,classes.getCurriculum_name());

        ps.executeUpdate();
    }
}
